<?php

require_once("View/LoginView.php");
require_once("Model/LoginHandler.php");
require_once("Controller/LoginController.php");
require_once("PageView.php");

class MasterController 
{
        public static function doControll() 
        {
        	//Skapar instanser
			$lc = new LoginController();
			$lh = new LoginHandler();
			$lw = new LoginView();
			$pw = new PageView();
                
			$html = $lc->DoControll();
			
			//Kollar om anv är inloggad
			if($lh->IsLoggedIn() == TRUE)
			{
				$msg= "</br>Inloggad";
				$html .= $lw->DoLogoutBox();
			}
			else
			{
				$msg = "</br>Utloggad";
				$html .= $lw->DoLoginBox();
			}
				
			$html .= $msg;                
                              
            return $pw->GetHTMLPage("Controller", $html);
        }
        
}

echo MasterController::doControll();

?>
